package com.artpri.model;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * CollectShopkeeper entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "collect_shopkeeper", catalog = "jpw")
public class CollectShopkeeper implements java.io.Serializable {

	// Fields

	private Integer csId;
	private ShopkeeperInfo shopkeeperInfo;
	private Integer userNum;
	private Integer attentionNum;
	private Timestamp createTime;

	// Constructors

	/** default constructor */
	public CollectShopkeeper() {
	}

	/** minimal constructor */
	public CollectShopkeeper(Integer attentionNum, Timestamp createTime) {
		this.attentionNum = attentionNum;
		this.createTime = createTime;
	}

	/** full constructor */
	public CollectShopkeeper(ShopkeeperInfo shopkeeperInfo, Integer userNum,
			Integer attentionNum, Timestamp createTime) {
		this.shopkeeperInfo = shopkeeperInfo;
		this.userNum = userNum;
		this.attentionNum = attentionNum;
		this.createTime = createTime;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "cs_id", unique = true, nullable = false)
	public Integer getCsId() {
		return this.csId;
	}

	public void setCsId(Integer csId) {
		this.csId = csId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "shopkeeper_num")
	public ShopkeeperInfo getShopkeeperInfo() {
		return this.shopkeeperInfo;
	}

	public void setShopkeeperInfo(ShopkeeperInfo shopkeeperInfo) {
		this.shopkeeperInfo = shopkeeperInfo;
	}

	@Column(name = "user_num")
	public Integer getUserNum() {
		return this.userNum;
	}

	public void setUserNum(Integer userNum) {
		this.userNum = userNum;
	}

	@Column(name = "attention_num", nullable = false)
	public Integer getAttentionNum() {
		return this.attentionNum;
	}

	public void setAttentionNum(Integer attentionNum) {
		this.attentionNum = attentionNum;
	}

	@Column(name = "create_time", nullable = false, length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

}